home *** CD-ROM | disk | FTP | other *** search
- function units_robot_alien_setup()
- units_setup(7,true,ENET_EFFECT_PS_SETUPSMOKE_LARGE,ENET_EFFECT_GEOMETRY_ROBOTALIENSHADOW)
- units_reloadfirespots(uniGetExecutor(),2,ENET_EFFECT_BULLET_ALIENROBOTROCKET)
- end
-
- function units_robot_alien_resetup()
- units_setup(7,true,nil,ENET_EFFECT_GEOMETRY_ROBOTALIENSHADOW)
- units_reloadfirespots(uniGetExecutor(),2,ENET_EFFECT_BULLET_ALIENROBOTROCKET)
- end
-
- function units_robot_alien_select()
- units_select(22,2)
- end
-
- function units_robot_alien_unselect()
- units_unselect()
- end
-
- function units_robot_alien_selectenemy()
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
- end
-
- function units_robot_alien_damaged()
- uniGetExecutor():applyDamage(uniGetLife())
- end
-
- function units_robot_alien_highlight()
- uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
- end
-
- function units_robot_alien_explode()
- --units_explode_big()
- units_explode_big1()
- end
-
- function units_robot_alien_move()
- local unit = uniGetExecutor()
- local steps = {}
- local i = 0;
- steps[0] = unit:getBone(ENBT_STEPEMITTER,0):addSimpleEffect(ENET_EFFECT_DYNAMICGEOMETRY_ROBOTALIENSTEPSEMITTER_LEFT)
- steps[1] = unit:getBone(ENBT_STEPEMITTER,1):addSimpleEffect(ENET_EFFECT_DYNAMICGEOMETRY_ROBOTALIENSTEPSEMITTER_RIGHT)
- local sound = unit:play3DSound("robot_alien_rotate.wav",1)
- unit:addAnimationToQueue(ENAT_TURNING,MATH_INFINITY)
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNIT,MATH_PI * 0.7))
- unit:addAnimationToQueue(ENAT_GO,MATH_INFINITY)
- unit:setCurrentAnimationRepeatCount(0)
- for i = 0,1 do
- steps[i+2] = unit:getBone(ENBT_STEPEMITTER,i):addSimpleEffect(ENET_EFFECT_PS_TRACKSMOKE)
- end
- waitDeath(unit:addMoveEffect(ENET_EFFECT_MOVE_LINEAR,120))
- unit:setCurrentAnimationRepeatCount(0)
- sound:destroy()
- unit:play3DSound("robot_alien_stop.wav",0):destroy()
- for i = 0,1 do
- if(unit:getScale() < 1.0) then
- steps[i]:destroy()
- else
- steps[i]:setTransformOwner()
- steps[i]:suspendedDestroy(70)
- end
- steps[i+2]:suspendedDestroy(1.0)
- end
- end
-
- function units_robot_alien_fire1()
- local unit = uniGetExecutor()
- uniSetLife(uniGetLife() / 8.0)
- local sound = unit:play3DSound("robot_alien_rotate.wav",1)
- unit:addAnimationToQueue(ENAT_TURNING,MATH_INFINITY)
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNIT,MATH_PI * 0.7,uniGetTarget()))
- unit:setCurrentAnimationRepeatCount(0)
- sound:destroy()
- local gn = unit:getBone(ENBT_TARGET)
- waitDeath(gn:getBone(ENBT_GUN):addRotationEffect(ENET_EFFECT_ROTATE_GUNTOTARGET,MATH_PI / 3.0,uniGetTarget()))
- local firespots = {}
- firespots[0] = gn:getBone(ENBT_FIRE1,0)
- firespots[1] = gn:getBone(ENBT_FIRE1,1)
- local i
- for i = 0,3 do
- unit:play3DSound("robot_alien_fire.wav",0):destroy()
- firespots[0]:addBulletEffect(ENET_EFFECT_BULLET_ENERGYSTAR):executeCommand(ENC_FIRE1)
- pause(0.1)
- unit:play3DSound("robot_alien_fire.wav",0):destroy()
- firespots[1]:addBulletEffect(ENET_EFFECT_BULLET_ENERGYSTAR):executeCommand(ENC_FIRE1)
- pause(0.1)
- end
- unit:addFireArrow()
- end
-
- function units_robot_alien_fire2()
- local unit = uniGetExecutor()
- uniSetLife(uniGetLife() / 2.0)
- local sound = unit:play3DSound("robot_alien_rotate.wav",1)
- unit:addAnimationToQueue(ENAT_TURNING,MATH_INFINITY)
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNIT,MATH_PI * 0.7,uniGetTarget()))
- unit:setCurrentAnimationRepeatCount(0)
- -- unit:resetAnimations()
- sound:destroy()
- local f_pause = 0.35
- unit:getBone(ENBT_FIRE2,0):findEffect(ENET_EFFECT_BULLET_ALIENROBOTROCKET):executeCommand(ENC_FIRE1)
- pause(f_pause)
- unit:getBone(ENBT_FIRE2,1):findEffect(ENET_EFFECT_BULLET_ALIENROBOTROCKET):executeCommand(ENC_FIRE1)
- pause(1.0)
- units_reloadfirespots(uniGetExecutor(),2,ENET_EFFECT_BULLET_ALIENROBOTROCKET)
- unit:addFireArrow()
- end
-
- registerCommand(ENSCRIPTSET_ROBOT_ALIEN,ENC_MOVE,"units_robot_alien_move")
- registerCommand(ENSCRIPTSET_ROBOT_ALIEN,ENC_FIRE1,"units_robot_alien_fire1")
- registerCommand(ENSCRIPTSET_ROBOT_ALIEN,ENC_FIRE2,"units_robot_alien_fire2")
- registerCommand(ENSCRIPTSET_ROBOT_ALIEN,ENC_SELECT,"units_robot_alien_select")
- registerCommand(ENSCRIPTSET_ROBOT_ALIEN,ENC_SELECTENEMY,"units_robot_alien_selectenemy")
- registerCommand(ENSCRIPTSET_ROBOT_ALIEN,ENC_UNSELECT,"units_robot_alien_unselect")
- registerCommand(ENSCRIPTSET_ROBOT_ALIEN,ENC_SETUP,"units_robot_alien_setup")
- registerCommand(ENSCRIPTSET_ROBOT_ALIEN,ENC_RESETUP,"units_robot_alien_resetup")
- registerCommand(ENSCRIPTSET_ROBOT_ALIEN,ENC_DAMAGED,"units_robot_alien_damaged")
- registerCommand(ENSCRIPTSET_ROBOT_ALIEN,ENC_EXPLODE,"units_robot_alien_explode")
- registerCommand(ENSCRIPTSET_ROBOT_ALIEN,ENC_HIGHLIGHT,"units_robot_alien_highlight")
- registerCommand(ENSCRIPTSET_ROBOT_ALIEN,ENC_INSIDE,"units_inside")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_ROBOT_ALIEN)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "robot_alien.rmd"
- desc.ScriptSet = ENSCRIPTSET_ROBOT_ALIEN
- desc.MoveType = ENMOVE_GROUND
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
-
- -- shadow
- desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_ROBOTALIENSHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "robot_alien_shadow.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(14)
- unitDesc.group = 0
- unitDesc.order = 3
- unitDesc.unit_res_id = ENET_UNIT_ROBOT_ALIEN
- unitDesc.unit_icon_id = "Robot_a_small_normal.dds"
- unitDesc.active_id = "Robot_a_small_active.dds"
- unitDesc.pressed_id = "Robot_a_small_pressed.dds"
- unitDesc.big_icon_id = "Robot_a_big_normal.dds"
- unitDesc.small_icon_id = "Robot_l_stats.dds"
- unitDesc.HP = 7
- unitDesc.MP = 20
- unitDesc.WR = 2
- unitDesc.min_WR = 1
- unitDesc.WD = 3
- unitDesc.WR2 = 0
- unitDesc.min_WR2 = 0
- unitDesc.WD2 = 0
- unitDesc.ability = 1
- unitDesc.transport = 0
- unitDesc.value = 4
- unitDesc.race = 1
- unitDesc.fire_pause = 0.6
- unitDesc.move_pause = 0.7
- unitDesc.unit_info_scale = 0.07
- unitDesc.scn_name = "HBOTA"
-
- ------------------------------------------------------------------------------------------------------
- ------------------------ effects related to unit------------------------------------------------------
- ------------------------------------------------------------------------------------------------------
-
- function bullets_energystar_fire()
- local bullet = uniGetExecutor()
- bullet:setTransformOwner()
- local light = bullet:addSimpleEffect(ENET_EFFECT_LIGHT_ENERGYSTARFLY)
- local track = bullet:addSimpleEffect(ENET_EFFECT_PS_ENERGYSTARFLY)
- waitDeath(bullet:addMoveEffect(ENET_EFFECT_MOVE_LINEARFLY,250,uniGetTarget()),1000)
- light:destroy()
- track:destroy()
- bullet:addSimpleEffect(ENET_EFFECT_PS_ENERGYSTARHIT):suspendedDestroy(1.0)
- uniGetTarget():executeCommand(ENC_DAMAGED)
- pause(1.0)
- bullet:destroy()
- end
-
- registerCommand(ENSCRIPTSET_BULLET_ENERGYSTAR,ENC_FIRE1,"bullets_energystar_fire")
-